<style>
    body {
        background-color: #ffffff;
    }

    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>

<div class="layui-form layuimini-form">

    <input type="hidden" value="{$model->id}" name="id">


    <div class="layui-form-item">
        <label class="layui-form-label required">快捷名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" autocomplete="off" class="layui-input" lay-verify="required" lay-reqtext="请输入快捷名称"
                   placeholder="请输入快捷名称" value="{$model->title}">
            <tip>填写快捷名称</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">快捷链接</label>
        <div class="layui-input-block">
            <input type="text" id="url" autocomplete="off" name="url" class="layui-input" lay-verify="required" lay-reqtext="请输入快捷链接" placeholder="请输入快捷链接"
                   value="{$model->url}">
            <tip>填写快捷链接</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">选择图标</label>
        <div class="layui-input-block">
            <input type="text" lay-verify="required" lay-reqtext="请选择图标"  id="iconPicker" name="icon" lay-filter="icon" class="hide" value="{$model->icon}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">target属性</label>
        <div class="layui-input-block">
            {foreach ['_self','_blank','_parent','_top'] as $vo}
            <input type="radio" name="target" value="{$vo}" title="{$vo}" {if $vo==$model->target}checked=""{/if}>
            {/foreach}
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="status">
                <option value="0" {if $model->status==0} selected="" {/if}>无效</option>
                <option value="1" {if $model->status==1} selected="" {/if}>有效</option>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'iconPickerFa'], function () {
        var iconPickerFa = layui.iconPickerFa;
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        iconPickerFa.render({
            // 选择器，推荐使用input
            elem: '#iconPicker',
            // fa 图标接口
            url: "/layuimini/lib/font-awesome-4.7.0/less/variables.less",
            // 是否开启搜索：true/false，默认true
            search: true,
            // 是否开启分页：true/false，默认true
            page: true,
            // 每页显示数量，默认12
            limit: 12,
            // 点击回调
            click: function (data) {
                console.log(data);
            },
            // 渲染成功后的回调
            success: function (d) {
                console.log(d);
            }
        });
        form.on('submit(saveBtn)', function (data) {
            var post_data = data.field;
            postData("{:url('quick_menu/edit')}",post_data,'修改成功');
            return false;
        });
    });
</script>